package gov.ccswj.modules.apibusiness.utils;

import org.apache.http.HttpStatus;

import java.util.HashMap;
import java.util.Map;

/**
 * api返回数据
 */
public class ApiR extends HashMap<String, Object> {
	private static final long serialVersionUID = 1L;
	
	public ApiR() {
		put("status", HttpStatus.SC_OK);
	}
	
	public static ApiR ok(String msg) {
		ApiR r = new ApiR();
		r.put("msg", msg);
		return r;
	}
	
	public static ApiR ok(Map<String, Object> map) {
		ApiR r = new ApiR();
		r.putAll(map);
		return r;
	}
	
	public static ApiR ok() {
		return new ApiR();
	}

	public ApiR put(String key, Object value) {
		super.put(key, value);
		return this;
	}
}
